Summary and Quiz on Filesystem Interactions

Let's conclude our discussion on filesystem interaction with a quiz to test our concepts.

We'll cover the following

Summary#

This section has provided us with a foundation for working with file I/O in the Go language. We learned about the io package and its file abstractions and how to read and write files to disk. Then, we learned how to stream file content so that we can work with the network and be more efficient with memory. After that, we learned about the path/filepath package, which can help us deal with multiple OSs. Finally, we learned about Go's filesystem-agnostic interfaces for interacting with any filesystem, starting with the new embed filesystem.

We highly encourage you to read the standard library’s GoDoc pages to become familiar with its capabilities. The following are the GoDocs that were covered in this section. Here, we can find many useful utilities for dealing with files.

Quiz#

10

What is a way for embed to embed files?

Your Answer
A)

As bytes

B)

As a string

C)

Into an embed.FS

Correct Answer
D)

All of the above

Question 10 of 1010 attempted

OS-Agnostic Filesystems

Introduction